<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" media="screen"
	href="<%=path %>/static/index/css/desktop.css" />
<script type="text/javascript" src="<%=path %>/static/index/js/jquery.js"></script>
<title>Insert title here</title>
<script>
	var message="${message}";
	if(message!=""){
		alert(message);
	}
</script>
</head>
<body>
	<div>
		<center>
			<div class="desk-comp">
				<img src="${backgroundUrl}" width="480"
					height="272" style="margin-top: 27px;" />
			</div>
		</center>
        <div style="position: absolute; bottom: 10px; right: 80px;">
        	<form action="<%=path%>/index/uploadImg" id="deskImgBG"
			method="post" enctype="multipart/form-data"
			class="form-horizontal no-margin">
        		<input type="file" style="display:none" name="imgFile" id="deskImg" onchange ="uploadFile()"/>
        		<input type="hidden" name="backgroundUrl" value="${backgroundUrl}" />
        	</form>
        	
        	<button id="search">浏 览</button>
        </div>
		<div style="position: absolute; bottom: 10px; right: 20px;">
			<button>确 定</button>
		</div>
	</div>
	<script>
		$(function(){
			$("#search").click(function(){
				$("#deskImg").click();
			})
		})
		function uploadFile(){
			//页面loading效果
			lock();
			$("#deskImgBG").submit();
			//update
		}
		//锁定按钮
		function lock(){
			$("#search").attr("disabled", true);
			
		}
	</script>
</body>
</html>